
*    -------------------------------------------------- 
*                                                       
*         $$$$$ $$$$$$$$    $    $$$$$$$$    $          
*        $$  $$ $  $$  $   $$    $  $$  $   $$          
*        $$   $    $$      $$$      $$      $$$         
*        $$$       $$     $ $$      $$     $ $$         
*          $$$     $$     $  $$     $$     $  $$        
*           $$$    $$     $$$$$     $$     $$$$$        
*        $   $$    $$    $   $$     $$    $   $$        
*        $$  $$    $$    $    $$    $$    $    $$       
*        $$$$$    $$$$  $$$  $$$$  $$$$  $$$  $$$$      
*                                                       
*    -------------------------------------------------- 
*                                                       
*
*
*       ____________________________________________________       
*       ————————————————————————————————————————————————————       
*                 2023年4月DID专题讲座                     
*                        远程直播                           
*                      (2023年4月)                      
*       _____________________________________________________       
*       ————————————————————————————————————————————————————— 
*                                                             
                           
*             
*             计量经济学服务中心&数量经济学
*                         2023年4月
*
*
*		  		                                            		  		  
*-------------------------------------------------------------------------------    
*        参考资料：
*        《初级计量经济学及Stata应用：Stata从入门到进阶》             
*        《高级计量经济学及Stata应用：Stata回归分析与应用》
*        《量化社会科学方法》
*        《社会科学因果推断》
*        《面板数据计量分析方法》
*        《时间序列计量分析方法》
*        《高级计量经济学及Eviews应用》
*        《R、Python、Mtalab初高级教程》
*        《空间计量入门：空间计量在Geoda、GeodaSpace中的应用》 
*        《零基础|轻松搞定空间计量：空间计量及GeoDa、Stata应用》
*        《空间计量第二部：空间计量及Matlab应用课程》
*        《空间计量第三部：空间计量及Stata应用课程》
*        《空间计量第四部：《空间计量及ArcGis应用课程》
*        《空间计量第五部：空间计量经济学》
*        《空间计量第六部：《空间计量及Python应用》
*        《空间计量第七部：《空间计量及R应用》
*        《空间计量第八部：《高级空间计量经济学》
*-------------------------------------------------------------------------------


*             ==========================================
*                 第十七讲   DID专题讲座---方法1
*             ==========================================


*             计量经济学服务中心&数量经济学




**#  案例应用
   cd "2023年中国工业经济\2023年第2期"
   use "东道国数据保护是否会抑制中国电商跨境并购\数据.dta"


/////////////////////////////////安慰剂检验/////////////////////////////////////
permute DID beta = _b[DID], reps(500) seed(100)  saving("计量经济学服务中心Simulations2.dta"): reghdfe lnDMA DID ln_pGDP growth real_exchange icrg lndis lntrade  comlang_off comrelig, absorb(adyear id ) cluster(id)


use "计量经济学服务中心Simulations2.dta", clear
#delimit ;
dpplot beta, xline(-0.038, lc(black*0.5) lp(dash))
             xline(0, lc(black*0.5) lp(solid))
             xtitle("Estimator", size(*0.8)) 
             xlabel(-0.05(10)0.05, labsize(small))
             ytitle("Density", size(*0.8)) 
             ylabel(, nogrid format(%4.1f) labsize(small)) 
             note("") caption("") 
             graphregion(fcolor(white)) ;
#delimit cr
graph export "计量经济学服务中心Simulations安慰剂检验.png", width(1000) replace





*             ==========================================
*                 第十七讲   DID专题讲座---方法2
*             ==========================================


*             计量经济学服务中心&数量经济学





*--------------------------------------------------------------	----------------		
* 第一步 DID估计
*--------------------------------------------------------------	
   cd C:\Users\Metrics\Desktop 
   use placebo2.dta,clear	
   reghdfe y did,absorb(id t) vce(cluster id)
   
   *did系数为

*--------------------------------------------------------------
*- 第二步 生成空矩阵以用于存储和作图调用	
*--------------------------------------------------------------


   mat b  = J(500,1,0)    
   mat se = J(500,1,0)    
   mat p  = J(500,1,0)    
 
*--------------------------------------------------------------	
*- 第三步 具体的抽样过程，抽样次数可以根据需要调整	中	
*--------------------------------------------------------------

forvalues i=1/500{
 *循环500次	
  use placebo2.dta, clear
  xtset id t                
  keep if t==2014                
  sample 500, count              
  keep id                        
  save match_id.dta, replace        
  merge 1:m id using placebo2.dta   
  
  gene treat = (_merge == 3)        
  gene time =  (t >= 2016)        
  gen did2 = treat*time
  quietly reghdfe y did2 ,absorb(id t) vce(cluster id) 
  

 mat  b[`i',1] = _b[did2]
 mat se[`i',1] = _se[did2]

 mat p[`i',1] = 2*ttail(e(df_r), abs(_b[did2]/_se[did2]))
}

*--------------------------------------------------------------	
*- 第四步 数据准备
*--------------------------------------------------------------
 
 * 矩阵转化为向量
  svmat b, names(coef)
  svmat se, names(se)
  svmat p, names(pvalue)

* 删除空值并添加标签
  drop if pvalue1 == .
  label var pvalue1 p值
  label var coef1 估计系数
  keep coef1 se1 pvalue1 
  
*--------------------------------------------------------------	
*- 第五步 作图
*--------------------------------------------------------------
  *set scheme qlean
  twoway  (kdensity coef1) (scatter pvalue1 coef1, msymbol(smcircle_hollow) mcolor(blue) ),  ///
  title("Placebo Test")  ///
  xlabel(-1(0.1)1) ylabel(,angle(0))  ///
  xline(0.79, lwidth(vthin) lp(shortdash))  /// *真实的估计为0.79，即真实数据回归得到的估计系数
  xtitle("Coefficients")      ///
  yline(0.1,lwidth(vthin) lp(dash))  ///
  ytitle(p value) ///
  legend(label(1 "kdensity of estimates") label( 2 "p value")) /// *图例说明
  plotregion(style(none))  ///无边框不需要边框
  graphregion(color(white))    //白色底图

  
  *结果为：

*-----------------------------------result.begin--------------------------------


  
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------
       panel variable:  id (strongly balanced)
        time variable:  t, 2011 to 2020
                delta:  1 unit
(9,000 observations deleted)
(500 observations deleted)
file match_id.dta saved

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,000
        from master                         0  (_merge==1)
        from using                      5,000  (_merge==2)

    matched                             5,000  (_merge==3)
    -----------------------------------------

. 
end of do-file

. do "C:\Users\Metrics\AppData\Local\Temp\STD00000000.tmp"

. 
. *-------------------------------------------------------------- 
. *- 第四步 数据准备
. *--------------------------------------------------------------
.  
.  * 矩阵转化为向量
.   svmat b, names(coef)

.   svmat se, names(se)

.   svmat p, names(pvalue)

. 
. * 删除空值并添加标签
.   drop if pvalue1 == .
(9,500 observations deleted)

.   label var pvalue1 p值

.   label var coef1 估计系数

.   keep coef1 se1 pvalue1 

.   
. *-------------------------------------------------------------- 
. 
end of do-file

. do "C:\Users\Metrics\AppData\Local\Temp\STD00000000.tmp"

. *-------------------------------------------------------------- 
. *- 第五步 作图
. *--------------------------------------------------------------
.   *set scheme qlean
.   twoway  (kdensity coef1) (scatter pvalue1 coef1, msymbol(smcircle_hollow) mcolor(b
> lue) ),  ///
>   title("Placebo Test")  ///
>   xlabel(-1(0.1)1) ylabel(,angle(0))  ///
>   xline(0.79, lwidth(vthin) lp(shortdash))  /// *真实的估计为0.79，即真实数据回归得
> 到的估计系数
>   xtitle("Coefficients")      ///
>   yline(0.1,lwidth(vthin) lp(dash))  ///
>   ytitle(p value) ///
>   legend(label(1 "kdensity of estimates") label( 2 "p value")) /// *图例说明
>   plotregion(style(none))  ///无边框不需要边框
>   graphregion(color(white))    //白色底图

. 
end of do-file





*-----------------------------------result.over--------------------------------

  